<script>
    layui.use(['layer', 'table', 'form','laydate'], function () {
        var table = layui.table;
        var form = layui.form;
        var layer = layui.layer;
        var laydate = layui.laydate;
        //监听提交
        form.on('submit(formSubmit)', function(data){
            data.field.content = UE.getEditor('editor').getContent();
            $.ajax({
                url:"{{route('admin.websitestyle.store')}}",
                method:'post',
                data:data.field,
                dataType:'JSON',
                success:function(res){
                    if(res.code == '0'){
                        layer.msg(res.msg,{icon: 6,time:1000},function(){
                            parent.location.reload();
                        });
                    } else{
                        layer.msg(res.msg,{shift: 6,icon: 5,time:1000});
                    }
                },
                error:function (data) {
                }
            })
            return false;
        });
    });
</script>
